package com.vne.skyemart.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "PaymentType",catalog = "skyemart_db")
public class PaymentType implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 6575860870745081683L;

	@Id
	@Column(name = "PaymentTypeID",nullable = false,unique = true)
	private int paymentTypeID;

	@Column(name = "Title",nullable = false,length = 250)
	private String title;

	@Column(name = "Description",length = 1000)
	private String description;

	@OneToMany(fetch = FetchType.LAZY,mappedBy = "paymentType")
	private Set<Payment> payments = new HashSet<Payment>(0);
	/**
	 * CONSTRUCTOR
	 * 
	 */
	public PaymentType() {}
	
	public PaymentType(int paymentTypeID, String title, String description,
			Set<Payment> payments) {
		super();
		this.paymentTypeID = paymentTypeID;
		this.title = title;
		this.description = description;
		this.payments = payments;
	}
	/**
	 * GETTER AND SETTER
	 * 
	 */
	public int getPaymentTypeID() {
		return paymentTypeID;
	}
	public void setPaymentTypeID(int paymentTypeID) {
		this.paymentTypeID = paymentTypeID;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Set<Payment> getPayments() {
		return payments;
	}
	public void setPayments(Set<Payment> payments) {
		this.payments = payments;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
